package com.store.app.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;

/**
 * 一些隐性意图的工具类
 */
public class IntentUtils {
	private static final String TAG = "IntentUtils";
	/**
	 * 打开外部浏览器 下载
	 * @param context
	 * @param downlink 下载链接
	 */
	public static void openBrowserToDownload(Context context,String downlink) {
		if (TextUtils.isEmpty(downlink)) {
			Log.v(TAG,String.format("downlink is null"));
			return ;
		}
		
		Intent intent = new Intent();
		intent.setAction(Intent.ACTION_VIEW);
		Uri data = Uri.parse(downlink);
		intent.setData(data);
		context.startActivity(intent);
	}
}
